;;;Place a standard Profile Grid array
;;;beginning at the lower left point you specify and
;;;terminating at the upper right point you specify.
;;;
;;;Uses UPOINT.LSP, MKLAYR.LSP
;;;
;;;	AUTHOR: HENRY C. FRANCIS
;;;		425 N. ASHE ST.
;;;		SOUTHERN PINES, NC 28387
;;;		All rights reserved without prejudice.
;;;
;;;	Copyright:	5-28-96
;;;	Edited:		12-6-2005
;;;
(defun c:adgrid ( / )
  (if upoint nil (load "upoint" "\nFile UPOINT.LSP not loaded! "))
  (setq llcor (upoint 1 "" "Lower left corner of new grid area" (if llcor llcor nil) nil))
  (setq urcor (upoint 1 "" "Upper right corner of new grid area" (if urcor urcor nil) nil))
  (setq llx (car llcor)
        lly (cadr llcor)
        llz (caddr llcor)
        urx (car urcor)
        ury (cadr urcor)
        hgy lly
        vgx llx
        count 0
  );setq
  (setq mjrg "C"
        llt "-"
        prod "SHBD"
        colra "D"
        modf "GRID"
  );setq
  (if mklayr nil (load "mklayr" "\nFile MKLAYR.LSP not loaded! "))
  (c:mklayr)
  (while
    (<= hgy ury)
    (if(eq(rem count 5)0)
      (progn
        (setq colra "E")
        (c:mklayr)
      );progn
    );if
    (entmake
      (list
        (cons 0 "LINE")
        (cons 10 (list llx hgy llz))
        (cons 11 (list urx hgy llz))
      )
    )
    (if(eq colra "E")
      (progn
        (setq colra "D")
        (c:mklayr)
      );progn
    );if
    (setq hgy (+ hgy 5))
    (setq count (1+ count))
  );while
  (setq count 0)
  (while
    (<= vgx urx)
    (if(eq(rem count 4)0)
      (progn
        (setq colra "E")
        (c:mklayr)
      );progn
    );if
    (entmake
      (list
        (cons 0 "LINE")
        (cons 10 (list vgx lly llz))
        (cons 11 (list vgx ury llz))
      )
    )
    (if(eq colra "E")
      (progn
        (setq colra "D")
        (c:mklayr)
      );progn
    );if
    (setq vgx (+ vgx 25))
    (setq count (1+ count))
  );while
);defun
